<h2 class="h2-title">Quản lý liên kết !!!</h2>

<p><a href="<?=base_url()?>backend/cms/createlink" class="bnt"style="margin-bottom: 15px;">Thêm mới</a></p>

<div class="clear"></div>
<?php if($this->native_session->flashdata('msg')):?>
    <ul class="notification succ">
        <li class="notifi_img"><img src="<?=base_url()?>assets/backend/css/images/icons/tick_circle.png"/></li>

        <li class="msg"><?=$this->native_session->flashdata('msg')?></li>

        <li class="close"><img src="<?=base_url()?>assets/backend/css/images/icons/cross_grey_small.png"/></li>

    </ul><!--End of .notification -->
<?php endif?>

<table class="pretty">
                    <thead>
                        <tr>
                            <th>Hình ảnh</th>
                            <th>Tên hãng</th>
                            <th>Đường dẫn</th>
                            <th>Chế độ mở</th>
                            <th>Trạng thái</th>
                            <th>Sửa</th>
                            <th>Xoá</th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php if(isset($msg)):?>
                            <td colspan="7"><?= $msg ?></td>
                        <?php else:?>
                            <?php foreach($links as $link):?>
                                <tr>
                                <td><img style="border: 1px solid #ddd;" width="150px" height="60px" src="<?=base_url()?><?=$link->link_image_thumb?>" /></td>
                                <td><?=character_limiter($link->link_company,50)?></td>
                                <td><?=$link->link?></td>
                                <?php if($link->link_open == 1):?>
                                    <td>Trang mới</td>
                                <?php else:?>
                                    <td>Mở tại trang hiện tại</td>
                                <?php endif;?>

                                <?php if($link->link_status == 1):?>
                                    <td>Hiển thị</td>
                                <?php else:?>
                                    <td>Ẩn</td>
                                <?php endif;?>
                                <td>
                                    <a href="<?=base_url()?>backend/cms/editlink/<?=$link->link_id?>" class="edit">
                                        <img src="<?=base_url()?>assets/backend/css/images/edit.png"/>
                                    </a>
                                </td>
                                <td>
                                    <a href="<?=base_url()?>backend/cms/dellink/<?=$link->link_id?>" class="delete">
                                        <img src="<?=base_url()?>assets/backend/css/images/delete.png"/>
                                    </a>
                                </td>
                                </tr>
                            <?php endforeach;?>
                        <?php endif;?>
                    </tbody>
                </table>